﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Xml.Linq;

namespace Lastfm7.ViewModels
{
    public abstract class ArtistListViewModel : MenuItemViewModel
    {
        public ObservableCollection<ArtistViewModel> Artists { get; set; }

        protected ArtistListViewModel()
        {
            Artists = new ObservableCollection<ArtistViewModel>();
        }

        protected ArtistListViewModel(string title, string description)
            : base(title, description)
        {
            Artists = new ObservableCollection<ArtistViewModel>();
        }


        public void AddArtists(IEnumerable<XElement> artistList)
        {
            foreach (var xArtist in artistList)
                Artists.Add(new ArtistViewModel(xArtist));
        }
    }
}
